//
//  GEObjectValueCollectionViewCell.m
//  ERP
//
//  Created by QA on 16/3/24.
//  Copyright © 2016年 ShangHai HaoLei Software Technology Co., Ltd. All rights reserved.
//

#import "GEObjectValueCollectionViewCell.h"
#import "RTSpinKitView.h"

//#define ProgressBarTableViewCellHeight 240.0

@interface GEObjectValueCollectionViewCell()

@property (nonatomic, strong) UIView *drawView;

@end

@implementation GEObjectValueCollectionViewCell

//绘制无数据页面
- (void)drawNotDataViewTableView:(UICollectionView*)tableView rect:(CGRect)frame
{
    [self drawNotDataNotReloadTableView:tableView rect:frame];
    [tableView reloadData];
}

//绘制无数据页面
- (void)drawNotDataNotReloadTableView:(UICollectionView*)tableView rect:(CGRect)frame
{
    if(self.drawView) [self.drawView removeFromSuperview];
    CGRect viewFrame = frame;
    UIView *view = [[UIView alloc] initWithFrame:viewFrame];
    
    UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"not_chart_f_bg"]];
    CGFloat imageViewWidth = imageView.frame.size.width;
    CGFloat imageViewHeight = imageView.frame.size.height;
    imageView.frame = CGRectMake(view.frame.size.width/2 - imageViewWidth/2, view.frame.size.height/2 - imageViewHeight/2 - 15,imageViewWidth,imageViewHeight);
    [view addSubview:imageView];
    
    UILabel *lable = [[UILabel alloc] initWithFrame:CGRectMake(imageView.frame.origin.x, imageView.frame.origin.y + imageViewHeight + 4, imageViewWidth, 26)];
    lable.textAlignment = NSTextAlignmentCenter;
    lable.font = [UIFont systemFontOfSize:15];
    lable.textColor = [UIColor colorWithRed:217/255.0 green:217/255.0 blue:217/255.0 alpha:1];
    lable.text = @"暂无数据";
    [view addSubview:lable];
    
    UIButton *button = [[UIButton alloc] initWithFrame:viewFrame];
    [view addSubview:button];
    
    [self.contentView addSubview:view];
    self.drawView = view;
}

@end
